#!/bin/bash

# this deliver precompiled package
# linux
# x86_64

src=$(adapt tool get http://glaros.dtc.umn.edu/gkhome/fetch/sw/parmetis/parmetis-4.0.3.tar.gz)

cd $src

#install here
prefix=$(adapt query sys/prefix)

# change float precission from default 32, it'd be more generic like system probe
#sed -i 's/IDXTYPEWIDTH 32/IDXTYPEWIDTH 64/;s/REALTYPEWIDTH 32/REALTYPEWIDTH 64/' metis/include/metis.h

# first compile the internal metis as it does not compile and install for some reasons

cd metis
adapt make config prefix=$prefix
make install

# compile parmetis with use of compiled metis
cd .. 

adapt make config prefix=$prefix
make install
